﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Rabbit.Converters
{
    [ValueConversion(typeof(int),typeof(int))]
    public class MinusConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int minus = 140;
            if (parameter != null)
            {
                int.TryParse(parameter.ToString(), out minus);
            }
            return minus - int.Parse(value.ToString());
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
